package cn.com.wangluotongxin.merchants.controller.dubbo;

import cn.com.wangluotongxin.admin.DAdminGoodsCatalogService;
import cn.com.wangluotongxin.admin.vo.DGoodsCatalogVo;
import cn.com.wangluotongxin.common.web.AjaxResult;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "管理端-商品分类 相关接口")
@RestController
@RequestMapping("/dubbo/admin/goods/catalog")
public class DubboAdminGoodsCatalogController {

    @Reference
    private DAdminGoodsCatalogService goodsCatalogService;

    @ApiOperation("树形列表")
    @GetMapping("/tree/list")
    public AjaxResult<List<DGoodsCatalogVo>> treeList() {
        return AjaxResult.success(goodsCatalogService.treeList());
    }
}
